//---------------------------------------------------------------------------

#ifndef GlassesModelDlgH
#define GlassesModelDlgH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ExtCtrls.hpp>

#include "CustomerBridge.h"
#include "GlassesBridge.h"
#include "CSPIN.h"

//---------------------------------------------------------------------------
class TfrmGlassesModelDlg : public TForm
{
__published:	// IDE-managed Components
        TPanel *pnlMain;
        TBitBtn *btnOk;
        TBitBtn *btnHelp;
        TBitBtn *btnCancel;
        TLabel *lblPrice;
        TLabel *lblName;
        TLabel *lblBought;
        TLabel *lblSold;
        TEdit *edtPrice;
        TEdit *edtName;
        TCSpinEdit *edtBought;
        TCSpinEdit *edtSold;
        TLabel *lblCurrency;
        TLabel *lblRemaining;
        TLabel *lblRemainingValue;
        void __fastcall btnOKClick(TObject *Sender);
        void __fastcall edtQuantityChange(TObject *Sender);
private:	// User declarations
        TStrings * models;
        TGlassesModel * model;

        bool ValidatePrice( TEdit * price);
        bool ValidateAmount( TCSpinEdit * amount);
        AnsiString GetRemaining();

public:		// User declarations
        __fastcall TfrmGlassesModelDlg(TComponent* Owner, TStrings * models);
        __fastcall TfrmGlassesModelDlg(TComponent* Owner, TStrings * models, TGlassesModel * model);
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmGlassesModelDlg *frmGlassesModelDlg;
//---------------------------------------------------------------------------
#endif
